<html class="pixel-ratio-1">
<head>
    <title>添加客户</title>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">

    <meta name="description" content="添加客户">

    {include file="common/link" /}
</head>

<body ontouchstart="">
<!--<div class="weui-cells__title">添加客户</div>-->
<!--    <div class="weui-cells weui-cells_form">-->
    <div class="weui-cell">
        <div class="weui-cell__hd"><label class="weui-label">公司名称</label></div>
        <div class="weui-cell__bd">
            <input class="weui-input validity" type="text"  placeholder="公司名称" name="company" value="{$row.company}">
        </div>
    </div>
    <div class="weui-cell">
        <div class="weui-cell__hd"><label class="weui-label">客户名称</label></div>
        <div class="weui-cell__bd">
            <input class="weui-input validity" type="text"  placeholder="客户名称" name="nickname" value="{$row.nickname}">
        </div>
    </div>
    <div class="weui-cell">
        <div class="weui-cell__hd"><label class="weui-label">联系人</label></div>
        <div class="weui-cell__bd">
            <input class="weui-input validity" type="text"  placeholder="联系人" name="contacts" value="{$row.contacts}">
        </div>
    </div>

    <div class="weui-cell">
        <div class="weui-cell__hd"><label class="weui-label">电话</label></div>
<!--        <div class="weui-cell__hd">-->
<!--            <div class="weui-cell__hd"><label class="weui-label">电话</label></div>-->
<!--            <select class="weui-select" name="select2">-->
<!--                <option value="1">+86</option>-->
<!--                <option value="2">+80</option>-->
<!--                <option value="3">+84</option>-->
<!--                <option value="4">+87</option>-->
<!--            </select>-->
<!--        </div>-->
        <div class="weui-cell__bd">
            <input class="weui-input validity" type="number" pattern="[0-9]*" placeholder="请输入号码" name="mobile" value="{$row.mobile}">
        </div>
    </div>

    <div class="weui-cells__title">客户详细地址</div>
    <div class="weui-cells weui-cells_form">
        <div class="weui-cell">
            <div class="weui-cell__bd">
                <textarea class="weui-textarea address validity" placeholder="请输入地址" rows="1" name="address">{$row.address}</textarea>
                <div class="weui-textarea-counter"><span>0</span>/50</div>
            </div>
        </div>
    </div>
    <div class="weui-cells__title">客户备注</div>
    <div class="weui-cells weui-cells_form">
        <div class="weui-cell">
            <div class="weui-cell__bd">
                <textarea class="weui-textarea remark validity" placeholder="请输入文本" rows="2" name="remark">{$row.remark}</textarea>
                <div class="weui-textarea-counter"><span>0</span>/200</div>
            </div>
        </div>
    </div>
</div>

<input type="hidden" value="{$row['id']}" class="c_id">
    <div class="weui-btn-area">
        <a class="weui-btn weui-btn_primary" href="javascript:" id="showTooltips">确定</a>
    </div>
<script src="https://cdn.bootcdn.net/ajax/libs/jquery/3.5.1/jquery.js"></script>

<script src="__CDN__/assets/web/plugins/fastclick.js"></script>
<script>
    $(function() {
        FastClick.attach(document.body);
    });
</script>
<script src="https://cdn.bootcss.com/jquery-weui/1.2.1/js/jquery-weui.min.js"></script>

<script src="https://cdn.bootcdn.net/ajax/libs/jquery/3.5.1/jquery.js"></script>
<script src="__CDN__/assets/web/layer/layer.js"></script>

<script>
    $("#showTooltips").click(function() {
        state = 1;
        $('.validity').each(function () {
            if($(this).val() == ''){
                $(this).show().focus();
                state = 0;
                return false
            }
        })
        if(state == 0){
            layer.msg('参数不能为空')
            return false
        }



        var  mobile= $('input[name="mobile"]').val()
        var  contacts= $('input[name="contacts"]').val()
        var  nickname= $('input[name="nickname"]').val()
        var  company= $('input[name="company"]').val()
        var  address= $('.address').val()
        var  remark= $('.remark').val()


        var url  = '{$turl}'+'/web/customer/edit';
        $.post(url,{ids:$('.c_id').val(),mobile:mobile,contacts:contacts,nickname:nickname,company:company,address:address,remark:remark},function (res) {
            layer.msg(res.msg)
            if(res.code >0){
                setTimeout(function () {
                    window.parent.location.reload(); //刷新父页面
                    var index = parent.layer.getFrameIndex(window.name); //获取窗口索引
                    parent.layer.close(index);  // 关闭layer
                },800);
            }
        })


        // var
        // var tel = $('#tel').val();
        // var code = $('#code').val();
        // if(!tel || !/1[3|4|5|7|8]\d{9}/.test(tel)) $.toptip('请输入手机号');
        // else if(!code || !/\d{6}/.test(code)) $.toptip('请输入六位手机验证码');
        // else $.toptip('提交成功', 'success');
    });
</script>
</body>
</html>




<!--    <div class="weui-cell">-->
<!--        <div class="weui-cell__hd"><label class="weui-label">客户详细地址</label></div>-->
<!--        <div class="weui-cell__bd">-->
<!--            <input class="weui-input" type="text" pattern="[0-9]*" placeholder="请输入qq号">-->
<!--        </div>-->
<!--    </div>-->

<!--    <div class="weui-cell">-->
<!--        <div class="weui-cell__hd"><label class="weui-label">客户详细地址</label></div>-->
<!--        <div class="weui-cell__bd">-->
<!--            <input class="weui-input" type="number" pattern="[0-9]*" placeholder="请输入qq号">-->
<!--        </div>-->
<!--    </div>-->
<!--    <div class="weui-cell weui-cell_vcode">-->
<!--        <div class="weui-cell__hd">-->
<!--            <label class="weui-label">手机号</label>-->
<!--        </div>-->
<!--        <div class="weui-cell__bd">-->
<!--            <input class="weui-input" type="tel" placeholder="请输入手机号">-->
<!--        </div>-->
<!--&lt;!&ndash;        <div class="weui-cell__ft">&ndash;&gt;-->
<!--&lt;!&ndash;            <button class="weui-vcode-btn">获取验证码</button>&ndash;&gt;-->
<!--&lt;!&ndash;        </div>&ndash;&gt;-->
<!--    </div>-->
<!--    <div class="weui-cell">-->
<!--        <div class="weui-cell__hd"><label class="weui-label">客户备注</label></div>-->
<!--        <div class="weui-cell__bd">-->
<!--            <input class="weui-input" type="number" pattern="[0-9]*" placeholder="请输入qq号">-->
<!--        </div>-->
<!--    </div>-->
<!--    <div class="weui-cell">-->
<!--        <div class="weui-cell__hd"><label for="" class="weui-label">日期</label></div>-->
<!--        <div class="weui-cell__bd">-->
<!--            <input class="weui-input" type="date" value="">-->
<!--        </div>-->
<!--    </div>-->
<!--    <div class="weui-cell">-->
<!--        <div class="weui-cell__hd"><label for="" class="weui-label">时间</label></div>-->
<!--        <div class="weui-cell__bd">-->
<!--            <input class="weui-input" type="datetime-local" value="" placeholder="">-->
<!--        </div>-->
<!--    </div>-->
<!--    <div class="weui-cell weui-cell_vcode">-->
<!--        <div class="weui-cell__hd"><label class="weui-label">验证码</label></div>-->
<!--        <div class="weui-cell__bd">-->
<!--            <input class="weui-input" type="number" placeholder="请输入验证码">-->
<!--        </div>-->
<!--        <div class="weui-cell__ft">-->
<!--            <img class="weui-vcode-img" src="./images/vcode.jpg">-->
<!--        </div>-->
<!--    </div>-->











<!--<div class="weui-cells__title">单选列表项</div>-->
<!--<div class="weui-cells weui-cells_radio">-->
<!--    <label class="weui-cell weui-check__label" for="x11">-->
<!--        <div class="weui-cell__bd">-->
<!--            <p>cell standard</p>-->
<!--        </div>-->
<!--        <div class="weui-cell__ft">-->
<!--            <input type="radio" class="weui-check" name="radio1" id="x11">-->
<!--            <span class="weui-icon-checked"></span>-->
<!--        </div>-->
<!--    </label>-->
<!--    <label class="weui-cell weui-check__label" for="x12">-->

<!--        <div class="weui-cell__bd">-->
<!--            <p>cell standard</p>-->
<!--        </div>-->
<!--        <div class="weui-cell__ft">-->
<!--            <input type="radio" name="radio1" class="weui-check" id="x12" checked="checked">-->
<!--            <span class="weui-icon-checked"></span>-->
<!--        </div>-->
<!--    </label>-->
<!--    <a href="javascript:void(0);" class="weui-cell weui-cell_link">-->
<!--        <div class="weui-cell__bd">添加更多</div>-->
<!--    </a>-->
<!--</div>-->
<!--<div class="weui-cells__title">复选列表项</div>-->
<!--<div class="weui-cells weui-cells_checkbox">-->
<!--    <label class="weui-cell weui-check__label" for="s11">-->
<!--        <div class="weui-cell__hd">-->
<!--            <input type="checkbox" class="weui-check" name="checkbox1" id="s11" checked="checked">-->
<!--            <i class="weui-icon-checked"></i>-->
<!--        </div>-->
<!--        <div class="weui-cell__bd">-->
<!--            <p>standard is dealt for u.</p>-->
<!--        </div>-->
<!--    </label>-->
<!--    <label class="weui-cell weui-check__label" for="s12">-->
<!--        <div class="weui-cell__hd">-->
<!--            <input type="checkbox" name="checkbox1" class="weui-check" id="s12">-->
<!--            <i class="weui-icon-checked"></i>-->
<!--        </div>-->
<!--        <div class="weui-cell__bd">-->
<!--            <p>standard is dealicient for u.</p>-->
<!--        </div>-->
<!--    </label>-->
<!--    <a href="javascript:void(0);" class="weui-cell weui-cell_link">-->
<!--        <div class="weui-cell__bd">添加更多</div>-->
<!--    </a>-->
<!--</div>-->


<!--<div class="weui-cells__tips">底部说明文字底部说明文字</div>-->

<!--<div class="weui-cells__title">表单报错</div>-->
<!--<div class="weui-cells weui-cells_form">-->
<!--    <div class="weui-cell weui-cell_warn">-->
<!--        <div class="weui-cell__hd"><label for="" class="weui-label">卡号</label></div>-->
<!--        <div class="weui-cell__bd">-->
<!--            <input class="weui-input" type="number" pattern="[0-9]*" value="weui input error" placeholder="请输入卡号">-->
<!--        </div>-->
<!--        <div class="weui-cell__ft">-->
<!--            <i class="weui-icon-warn"></i>-->
<!--        </div>-->
<!--    </div>-->
<!--</div>-->


<!--<div class="weui-cells__title">开关</div>-->
<!--<div class="weui-cells weui-cells_form">-->
<!--    <div class="weui-cell weui-cell_switch">-->
<!--        <div class="weui-cell__bd">标题文字</div>-->
<!--        <div class="weui-cell__ft">-->
<!--            <input class="weui-switch" type="checkbox">-->
<!--        </div>-->
<!--    </div>-->
<!--    <div class="weui-cell weui-cell_switch">-->
<!--        <div class="weui-cell__bd">兼容IE Edge的版本</div>-->
<!--        <div class="weui-cell__ft">-->
<!--            <label for="switchCP" class="weui-switch-cp">-->
<!--                <input id="switchCP" class="weui-switch-cp__input" type="checkbox" checked="checked">-->
<!--                <div class="weui-switch-cp__box"></div>-->
<!--            </label>-->
<!--        </div>-->
<!--    </div>-->
<!--</div>-->

<!--<div class="weui-cells__title">文本框</div>-->
<!--<div class="weui-cells">-->
<!--    <div class="weui-cell">-->
<!--        <div class="weui-cell__bd">-->
<!--            <input class="weui-input" type="text" placeholder="请输入文本">-->
<!--        </div>-->
<!--    </div>-->
<!--</div>-->

<!--<div class="weui-cells__title">文本域</div>-->
<!--<div class="weui-cells weui-cells_form">-->
<!--    <div class="weui-cell">-->
<!--        <div class="weui-cell__bd">-->
<!--            <textarea class="weui-textarea" placeholder="请输入文本" rows="3"></textarea>-->
<!--            <div class="weui-textarea-counter"><span>0</span>/200</div>-->
<!--        </div>-->
<!--    </div>-->
<!--</div>-->

<!--<div class="weui-cells__title">选择</div>-->
<!--<div class="weui-cells">-->

<!--    <div class="weui-cell weui-cell_select weui-cell_select-before">-->
<!--        <div class="weui-cell__hd">-->
<!--            <select class="weui-select" name="select2">-->
<!--                <option value="1">+86</option>-->
<!--                <option value="2">+80</option>-->
<!--                <option value="3">+84</option>-->
<!--                <option value="4">+87</option>-->
<!--            </select>-->
<!--        </div>-->
<!--        <div class="weui-cell__bd">-->
<!--            <input class="weui-input" type="number" pattern="[0-9]*" placeholder="请输入号码">-->
<!--        </div>-->
<!--    </div>-->
<!--</div>-->
<!--<div class="weui-cells__title">选择</div>-->
<!--<div class="weui-cells">-->
<!--    <div class="weui-cell weui-cell_select">-->
<!--        <div class="weui-cell__bd">-->
<!--            <select class="weui-select" name="select1">-->
<!--                <option selected="" value="1">微信号</option>-->
<!--                <option value="2">QQ号</option>-->
<!--                <option value="3">Email</option>-->
<!--            </select>-->
<!--        </div>-->
<!--    </div>-->
<!--    <div class="weui-cell weui-cell_select weui-cell_select-after">-->
<!--        <div class="weui-cell__hd">-->
<!--            <label for="" class="weui-label">国家/地区</label>-->
<!--        </div>-->
<!--        <div class="weui-cell__bd">-->
<!--            <select class="weui-select" name="select2">-->
<!--                <option value="1">中国</option>-->
<!--                <option value="2">美国</option>-->
<!--                <option value="3">英国</option>-->
<!--            </select>-->
<!--        </div>-->
<!--    </div>-->
<!--</div>-->

<!--<label for="weuiAgree" class="weui-agree">-->
<!--    <input id="weuiAgree" type="checkbox" class="weui-agree__checkbox">-->
<!--    <span class="weui-agree__text">-->
<!--        阅读并同意<a href="javascript:void(0);">《相关条款》</a>-->
<!--      </span>-->
<!--</label>-->
